<?php require_once(dirname(__FILE__) . '/inc/config.inc.php');
IsModelPriv('goods_order'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>订单管理</title>
    <link href="templates/style/admin.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="templates/js/jquery.min.js"></script>
    <script type="text/javascript" src="templates/js/forms.func.js"></script>
</head>
<body>
<div class="topToolbar">
    <span class="title">订单管理</span>
    <a href="javascript:location.reload();" class="reload">刷新</a>
</div>


<form name="form" id="form" method="post" action="member_save.php">
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="dataTable">
        <tr align="left" class="head" style="text-align: center;">

            <td width="2%" height="36" class="firstCol">订单号</td>
            <td width="5%">商品名称</td>
            <td width="5%">买家名称</td>
            <td width="5%">商户id</td>
            <td width="5%">数量</td>
            <td width="5%">单价</td>
            <td width="5%">订单金额</td>
            <td width="5%">订单状态</td>
            <td width="5%">下单时间</td>
            <td width="5%">操作</td>
        </tr>
        <?php
        $stats = ['未付款', '已付款', '待使用', '已使用', '已过期', '已发起退款', '退款已通过', '退款已驳回'];
        $dopage->GetPage("SELECT a.*,b.title FROM `#@__goods_order` a left join `#@__goods` b on a.goods_id=b.id");
        while ($row = $dosql->GetArray()) {
            ?>
            <tr align="left" class="dataTr" style="text-align: center;">

                <td height="60" class="firstCol"><?php echo $row['ordernum']; ?></td>
                <td><?php echo $row['title']; ?></td>
                <td><?php echo $row['u_name']; ?></td>
                <td><?php echo $row['shop_id']; ?></td>
                <td><?php echo $row['number']; ?></td>
                <td><?php echo $row['Price']; ?></td>
                <td><?php echo $row['money']; ?></td>
                <td><?php echo isset($stats[$row['state']]) ? $stats[$row['state']] : '其他'; ?></td>
                <td><?php echo date('Y-m-d H:i:s', intval($row['time'])); ?></td>
                <td>
                    <a href="order_info.php?id=<?php echo $row['id']; ?>"
                       style="height:30px;width:80px;text-align:center;  font-style:normal; display: inline-block;line-height: 30px;background: #509ee1;color: #ffffff;border-radius: 5px;font-size: 12px;">查看</a>
                </td>
            </tr>
            <?php
        }
        ?>
    </table>
</form>


<?php

//判断无记录样式
if ($dosql->GetTotalRow() == 0) {
    echo '<div class="dataEmpty">暂时没有相关的记录</div>';
}
?>

<div class="page"> <?php echo $dopage->GetList(); ?> </div>
<?php

//判断是否启用快捷工具栏
if ($cfg_quicktool == 'Y') {
    ?>
    <div class="quickToolbar">
        <div class="qiuckWarp">
            <div class="quickArea"><span class="selArea"><span>选择：</span> <a href="javascript:CheckAll(true);">全部</a> - <a
                            href="javascript:CheckAll(false);">无</a> - <a
                            href="javascript:DelAllNone('member_save.php');"
                            onclick="return ConfDelAll(0);">删除</a></span> <a href="member_add.php"
                                                                             class="dataBtn">注册新会员</a> <span
                        class="pageSmall"> <?php echo $dopage->GetList(); ?> </span></div>
            <div class="quickAreaBg"></div>
        </div>
    </div>
    <?php
}
?>
</body>
</html>
